import request, { Method } from '@/plugins/request.js';

// 游客信息 - 添加与编辑
export function visitorCache(data) {
  return request({
    url: '/buyer/visitor/visitor/cache',
    method: Method.POST,
    needToken: true,
    headers: {'Content-Type': 'application/json'},
    data
  });
}

export function visitorList () {
  return request({
    url: '/buyer/visitor/visitor/list',
    method: Method.get,
    needToken: true
  });
}

/**
 * 游客 - 保存
 * @param params
 */
export function visitorSave (params) {
  return request({
    url: '/buyer/visitor/visitor/save',
    method: Method.POST,
    needToken: true,
    headers: {'Content-Type': 'application/json'},
    data: params
  });
}

/**
 * 删除单个
 * @param params
 * @param handleSuccess
 */
export const visitorDelete = (params) => {
  return request({
    url: `/buyer/visitor/visitor/deleteIds`,
    method: Method.DELETE,
    needToken: true,
    params
  });
}
